home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 1.6 KB | 35 lines | [TEXT/GEOL] |
- Item forwarded by NASSI to HARTLEY.AK
-
- Item forwarded by SCHMUCKER1 to NASSI
-
- Item 1956037 27-Aug-90 09:49PDT
-
- From: RANSON France - Dev, Ranson Lannion,IDV
-
- To: MACAPP.TECH$ MacApp Technical
-
- Sub: Re(n) Multiple inheritance
-
- James, Larry, Cliff, Geoff, ...
-
- My experience is that multiple inheritance really shines when you have a class
- hierarchy that you don't control (either you bought it as a compiled library,
- or the users of YOUR library will write it sometime in the future), and your
- want to build a parallel hierarchy with slightly different behaviour.
- Example 1: Imagine that MacApp views didn't have borders. You could write a
- small class whose only purpose is to draw borders. A class derived from it and
- any view class would be a view with borders.
- Example 2: Tracing the behaviour of an objet. To trace the do/undo/redo
- messages in commands, you could write a class that prints information on each
- of these messages, and "mix" it with any command class to obtain a traced
- command class.
- Unfortunately, there are very few languages in which this works easily. I am
- using CLOS (Common Lisp Object System), which allows me to specify how the
- classes will mix, and to define INCOMPLETE classes, that can only works when
- combined with another class by multiple inheritance. In C++ or Eiffel, the way
- inherited methods are called is defined ONLY by the descendant, and all member
- (feature) references must be resolved at compile-time.
- How about a MacApp in CLOS?
- Daniel Ranson.
-
-